top_builddir = ..

include ../config.mk

FWPK_NAME=$(shell echo $$FWPK_NAME)
ifeq ($(FWPK_NAME),)
FWPK_NAME=Test\ product
endif

CPPFLAGS = $(BASECPPFLAGS) -I../include $(RUDIMENTSCFLAGS) -DFWPK_NAME=\"$(FWPK_NAME)\"
LIBS = $(RUDIMENTSLIBS)

.SUFFIXES: .lo

.cpp.lo:
	$(LTCOMPILE) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(COMPILE) $< $(OUT)$@

.cpp.obj:
	$(LTCOMPILE) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(COMPILE) $<

all: cleanish product

product: product.cpp product.$(OBJ)
	$(LTLINK) $(LINK) $(LDFLAGS) $(OUT)$@$(EXE) product.$(OBJ) $(LIBS)

cleanish:
	$(LTCLEAN) $(RM) *.lo *.$(OBJ) product$(EXE)
	$(RMTREE) .libs

clean: cleanish
	$(LTCLEAN) $(RM) product.key
